package dondeestamitransporte.actividadesPasajero;



import dondeestamitransporte.actividadesChofer.MenuConductorActivity;
import android.app.Activity;
import dondeestamitransporte.actividades.R;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.widget.TabHost;

public class MenuPrincipal extends Activity {
	
	private TabHost tablaMenuPrincipal;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Intent launchNewIntent = new Intent(this,MenuInicioPasajeroActivity.class);
    	startActivity(launchNewIntent);
		
		/*tablaMenuPrincipal  = getTabHost();
		
		TabHost.TabSpec spec1=tablaMenuPrincipal.newTabSpec("Pasajero");
        Intent intent1=new Intent(this, MenuInicioPasajeroActivity.class);
        spec1.setContent(intent1);
       // spec1.setIndicator("Tab 1", getResources().getDrawable(R.drawable.face));
        spec1.setIndicator("Pasajero");
        tablaMenuPrincipal.addTab(spec1);

        TabHost.TabSpec spec2=tablaMenuPrincipal.newTabSpec("Chofer");
        Intent intent2=new Intent(this,MenuConductorActivity.class);
        spec2.setContent(intent2);
     //   spec1.setIndicator("Tab 2", getResources().getDrawable(R.drawable.face));
        spec2.setIndicator("Chofer");
        tablaMenuPrincipal.addTab(spec2);*/
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {

		// Inflate the menu; this adds items to the action bar if it is present.
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu_principal, menu);
		return true;
	}
	
	public boolean onOptionsItemSelected(MenuItem item)
    {
         
        switch (item.getItemId())
        {
        case R.id.Pasajero:
        	Intent launchNewIntent = new Intent(this,MenuInicioPasajeroActivity.class);
        	startActivity(launchNewIntent);
            return true;
 
        case R.id.Chofer:
        	Intent launchNewIntent2 = new Intent(this,MenuConductorActivity.class);
        	startActivity(launchNewIntent2);
            return true;
 
        default:
            return super.onOptionsItemSelected(item);
        }
    }  


}
